package utils.info;

import java.awt.Color;
import javax.swing.JComponent;
import javax.swing.JLabel;
import net.java.balloontip.BalloonTip;
import net.java.balloontip.styles.MinimalBalloonStyle;

/**
 *
 * @author Juan Carlos García
 */
public class InfoUtils {
    
    /**
     * This method creates an info BallonTip in the current component
     * 
     * @param component The component where the BallonTip will be displayed
     * @param text The Text of the info panel
     * @param x 
     * @param y
     * @param closeable If is or is not closeable 
     */
    public static void createInfo(JComponent component, String text,int x,int y,boolean closeable,Color color){
        
        //Adding BallonTip TODO: Create a Class to manage BallonTips
        MinimalBalloonStyle mBStyle = new MinimalBalloonStyle(color,12);
        BalloonTip balloon = new BalloonTip(component,new JLabel(text), mBStyle,BalloonTip.Orientation.LEFT_ABOVE, BalloonTip.AttachLocation.EAST,x,y,closeable); 
        balloon.addDefaultMouseListener(true);
        
    }
    
}
